package cn.hist.hfp.repository;

import cn.hist.hfp.entity.Comment;
import cn.hist.hfp.entity.Stray;
import cn.hist.hfp.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CommentRepository extends JpaRepository<Comment, Integer>{

    Page<Comment> findAllByStray(Stray stray, Pageable pageable);

    Page<Comment> findAllByUser(User user, Pageable pageable);
}
